<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>3.改变promise的状态</title>
</head>
<body>
    <script>
          new Promise(((resolve, reject) => {
              //内部的报错会直接将Promise的状态变成rejected
              a("error");
          })).then(
                  value => {
                    console.log("成功了"+value);},
                  reason => {
                    console.log("失败了"+reason);
                  }

          )

    </script>
</body>
</html>